<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象方法扩展</title>
</head>
<body>
<script>
    //创建一个对象
    const school = {
        name: 'zhangSan',
        cities: ['北京', '上海', '深圳'],
        subjects: ['语文', '数学', '体育', '英语']
    }
    console.log(school)
    // 1. 获取对象所有的键
    console.log(Object.keys(school))
    // 2. 获取对象所有的值
    console.log(Object.values(school))
    // 3. entries -- 将school对象转换为数组
    console.log(Object.entries(school))
    // 创建Map
    const map = new Map(Object.entries(school));
    console.log(map.get('subjects'))
    // 4. getOwnPropertyDescriptors -- 对象属性的描述对象
    console.log(Object.getOwnPropertyDescriptors(school))
</script>
</body>
</html>